//
// CViewport.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CViewport {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CViewport(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CViewport obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CViewport(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CViewport() {
    this(nel3dJNI.new_CViewport(), true);
  }

  public void init(float x, float y, float width, float height) {
    nel3dJNI.CViewport_init(swigCPtr, this, x, y, width, height);
  }

  public void initFullScreen() {
    nel3dJNI.CViewport_initFullScreen(swigCPtr, this);
  }

  public void init16_9() {
    nel3dJNI.CViewport_init16_9(swigCPtr, this);
  }

  public void getRayWithPoint(float x, float y, CVector pos, CVector dir, SWIGTYPE_p_NLMISC__CMatrix camMatrix, CFrustum camFrust) {
    nel3dJNI.CViewport_getRayWithPoint(swigCPtr, this, x, y, CVector.getCPtr(pos), pos, CVector.getCPtr(dir), dir, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(camMatrix), CFrustum.getCPtr(camFrust), camFrust);
  }

  public void getValues(SWIGTYPE_p_float x, SWIGTYPE_p_float y, SWIGTYPE_p_float width, SWIGTYPE_p_float height) {
    nel3dJNI.CViewport_getValues(swigCPtr, this, SWIGTYPE_p_float.getCPtr(x), SWIGTYPE_p_float.getCPtr(y), SWIGTYPE_p_float.getCPtr(width), SWIGTYPE_p_float.getCPtr(height));
  }

  public float getX() {
    return nel3dJNI.CViewport_getX(swigCPtr, this);
  }

  public float getY() {
    return nel3dJNI.CViewport_getY(swigCPtr, this);
  }

  public float getWidth() {
    return nel3dJNI.CViewport_getWidth(swigCPtr, this);
  }

  public float getHeight() {
    return nel3dJNI.CViewport_getHeight(swigCPtr, this);
  }

}
